The classic application of the flag bit in the MCU C language allows you to quickly learn the MCU C language

//====Flag bit application definition union entity====typedef union uFLG{ uint8 Flg; //define plastic data struct FLAG{ //bit field definition uint8 Flg1: 1; uint8 Flg2: 1; uint8 Flg3: 1; uint8 Flg4: 1; uint8 Flg5: 1; uint8 Flg6: 1; uint8 Flg7: 1; uint8 Flg8: 1; }tFlg; }uFlg;uFlg uF1,uF2; //Define the union variable //---- ---uF1-------------------#define uFg1 uF1.Flg#define F_10MS uF1.tFlg.Flg1#define F_Fls1s uF1.tFlg.Flg2#define F_Fls uF1. tFlg.Flg3#define F_FlsQ uF1.tFlg.Flg4//-------uF2-------------------#define uFg2 uF2.Flg#define F_LED1 uF2 .tFlg.Flg1#define F_LED2 uF2.tFlg.Flg2#define F_LED3 uF2.tFlg.Flg3//----Application example------void main(void){ while(1) {//F_10MS is interrupting Set 10MS once to 1 while(!F_10MS); //The main program 10MS executes once F_10MS = 0; Cmdkey(); CmdDisplay(); uFg2 = 0; //directly manipulate the entire byte F_LED1 = 1; //independent operation word A bit in the section))

The classic application of the flag bit in the MCU C language allows you to quickly learn the MCU C language

Photovoltaic New Energy Magnetic Ring Inductor

Photovoltaic New Energy Magnetic Ring Inductor,Common Mode Toroidal Inductors,High Frequency High Power Inductors,Three-Phase Common Mode Filter Inductor

Shenzhen Sichuangge Magneto-electric Co. , Ltd , https://www.scginductor.com